package com.company.indicationshots.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.company.indicationshots.activity.MainActivity;
//app自启动管理类
public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
            // 在这里启动你的应用或服务
            Intent i = new Intent(context, MainActivity.class);
            i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(i);
        }
    }
}
